package com.google.code.chaotic.model;

import java.io.Serializable;

import org.apache.commons.lang.ObjectUtils;

@SuppressWarnings("serial")
public class HabitInServicePk implements Serializable {

	private String serviceId;

	private String habitId;

	//

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((serviceId == null) ? 0 : serviceId.hashCode());
		result = prime * result + ((habitId == null) ? 0 : habitId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof HabitInServicePk))
			return false;
		HabitInServicePk other = (HabitInServicePk) obj;
		if (ObjectUtils.equals(serviceId, other.serviceId))
			return false;
		if (ObjectUtils.equals(habitId, other.habitId))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return new StringBuilder().append("Service: ( ").append("serviceId: ")
				.append(serviceId).append(", habitId: ").append(habitId)
				.append(" )").toString();
	}

	public void setServiceId(String serviceId) {
		this.serviceId = serviceId;
	}

	public String getServiceId() {
		return serviceId;
	}

	public void setHabitId(String habitId) {
		this.habitId = habitId;
	}

	public String getHabitId() {
		return habitId;
	}

}